package cn.swust.designpatternlearningplatform.dao;

import cn.swust.designpatternlearningplatform.dao.sql.ClassManagementDaoSql;
import cn.swust.designpatternlearningplatform.domain.bo.StudentSimplyInformationBo;
import cn.swust.designpatternlearningplatform.domain.entity.Student;
import org.apache.ibatis.annotations.*;

import java.util.List;
import java.util.Set;

@Mapper
public interface ClassManagementDao {
    @SelectProvider(type = ClassManagementDaoSql.class,method = "getSemester")
    Set<String> getSemester(String teacherAccount);
    @SelectProvider(type = ClassManagementDaoSql.class,method = "getClassNUmber")
    List<String> getClassNUmber(String semester,String teacherAccount);

//    @SelectProvider(type = ClassManagementDaoSql.class,method = "getStudentNumber")
//    Integer getStudentNumber(String s);
    @Results(value = {
            @Result(property = "name",column = "student_name"),
            @Result(property = "number",column = "student_number"),
            @Result(property = "placeOfClass",column = "place_of_class"),
            @Result(property = "classAndGrade",column = "class_and_grade"),
            @Result(property = "college",column = "college"),
            @Result(property = "reworkMark",column = "rework_mark"),
            @Result(property = "paymentStatus",column = "payment_status"),
            @Result(property = "schoolTime",column = "school_time"),
    })
    @SelectProvider(type = ClassManagementDaoSql.class,method = "getList")
    List<StudentSimplyInformationBo> getList(String classNumber, String semester, String teacherAccount);
    @Results(value = {
            @Result(property = "name",column = "student_name"),
            @Result(property = "number",column = "student_number"),
            @Result(property = "placeOfClass",column = "place_of_class"),
            @Result(property = "classAndGrade",column = "class_and_grade"),
            @Result(property = "college",column = "college"),
            @Result(property = "reworkMark",column = "rework_mark"),
            @Result(property = "paymentStatus",column = "payment_status"),
            @Result(property = "schoolTime",column = "school_time"),
    })
    @SelectProvider(type = ClassManagementDaoSql.class,method = "getAllList")
    List<StudentSimplyInformationBo> getAllList(String semester, String teacherAccount);
//   @InsertProvider(type = ClassManagementDaoSql.class,method = "BuildClass")
//   void BuildClass(String teacherName,String teacherAccount, String classNumber, String semester);
   @InsertProvider(type = ClassManagementDaoSql.class,method = "AddStudent")
    void AddStudent(Student student);
   @DeleteProvider(type = ClassManagementDaoSql.class,method = "DeleteClass")
    void DeleteClass(String semester, String classNumber, String teacherAccount);
   @DeleteProvider(type = ClassManagementDaoSql.class,method = "DeleteStudent")
    void DeleteStudent(String s);
}
